/***************************************************************************
 *   Copyright (C) 2008 Stefan Majewsky <majewsky@gmx.net>
 *
 *   This program is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU General Public
 *   License as published by the Free Software Foundation; either
 *   version 2 of the License, or (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 ***************************************************************************/

#ifndef KANDAS_CLIENT_SLOTMODEL_H
#define KANDAS_CLIENT_SLOTMODEL_H

#include "manager.h"
#include <QAbstractListModel>

namespace Kandas
{
    namespace Client
    {

        class SlotModel : public QAbstractListModel
        {
            friend void Kandas::Client::Manager::changeEnvironment(int state);
            Q_OBJECT
            public:
                SlotModel(Manager *parent = 0);
                ~SlotModel();

                QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
                QVariant headerData(int index, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
                int rowCount(const QModelIndex &parent = QModelIndex()) const;
            public slots:
                void changeSelectedDevice(int index);

                void deviceAdded(int deviceIndex);
                void deviceRemoved(int deviceIndex);
                void slotAboutToBeAdded(int deviceIndex, int slotIndex);
                void slotAdded(int deviceIndex);
                void slotChanged(int deviceIndex, int slotIndex);
                void slotAboutToBeRemoved(int deviceIndex, int slotIndex);
                void slotRemoved(int deviceIndex);
            private:
                Manager *p;
                int m_currentDevice;
        };

    }
}

#endif // KANDAS_CLIENT_SLOTMODEL_H
